package com.zhongen.oa.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongen.common.security.service.PigUser;
import com.zhongen.common.security.util.SecurityUtils;
import com.zhongen.oa.entity.ProjectTaskBugEntity;
import com.zhongen.oa.entity.vo.ProjectTaskBugVo;
import com.zhongen.oa.mapper.ProjectTaskBugMapper;
import com.zhongen.oa.service.ProjectTaskBugService;
import org.springframework.stereotype.Service;

/**
 * bug表
 *
 * @author Code Generator
 * @date 2024-04-16 16:46:15
 */
@Service
public class ProjectTaskBugServiceImpl extends ServiceImpl<ProjectTaskBugMapper, ProjectTaskBugEntity>
		implements ProjectTaskBugService {

	@Override
	public IPage<ProjectTaskBugVo> pageList(Page page, ProjectTaskBugEntity projectTaskBug) {
		return baseMapper.pageList(page, projectTaskBug);
	}

	@Override
	public IPage<ProjectTaskBugVo> pageListApp(Page page, ProjectTaskBugEntity projectTaskBug) {
		if(projectTaskBug.getCommander()!=null){
			PigUser loginUser = SecurityUtils.getUser();
			projectTaskBug.setCommander(loginUser.getId());
		}
		return baseMapper.pageListApp(page, projectTaskBug);
	}

}
